<div class="row">
    <div class="col-md-3 side-menu">
        <div>
            <nav class="navbar navbar-dark">
                <ul class="navbar-nav w-100" [ngSwitch]="isAuthenticated()">
                    <li class="nav-item" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}" *ngSwitchCase="true">
                        <a class="nav-link" routerLink="/">
                            <div class="menu-item-content">
                                <fa-icon icon="home" class="menu-icon"></fa-icon>
                                <span class="menu-text">首页</span>
                            </div>
                        </a>
                    </li>

                    <li class="nav-item" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}"
                        *ngIf="(gitConfig.githubAvailable || gitConfig.gitlabAvailable) && isAuthenticated()">
                        <a class="nav-link" routerLink="/git">
                            <div class="menu-item-content">
                                <fa-icon icon="wrench" class="menu-icon"></fa-icon>
                                <span class="menu-text">配置</span>
                            </div>
                        </a>
                    </li>

                    <li class="nav-item" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">
                        <a class="nav-link" routerLink="/generate-application">
                            <div class="menu-item-content">
                                <fa-icon icon="rocket" class="menu-icon"></fa-icon>
                                <span class="menu-text">创建应用</span>
                            </div>
                        </a>
                    </li>

                    <!-- <li class="nav-item" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">
                        <a class="nav-link" routerLink="/generate-azure-application">
                            <div class="menu-item-content">
                                <img src="content/images/azure-logo.svg" alt="Azure" class="azure-icon">
                                <span class="menu-text">Azure应用</span>
                            </div>
                        </a>
                    </li> -->

                    <li class="nav-item" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}" *ngSwitchCase="true">
                        <a class="nav-link" routerLink="/design-entities">
                            <div class="menu-item-content">
                                <fa-icon icon="project-diagram" class="menu-icon"></fa-icon>
                                <span class="menu-text">设计实体</span>
                            </div>
                        </a>
                    </li>
<!-- 
                    <li class="nav-item" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}" *ngSwitchCase="true">
                        <a class="nav-link" routerLink="/ci-cd">
                            <div class="menu-item-content">
                                <fa-icon icon="cloud-upload-alt" class="menu-icon"></fa-icon>
                                <span class="menu-text">CI/CD</span>
                            </div>
                        </a>
                    </li> -->

                    <li class="nav-item" *ngSwitchCase="false">
                        <a class="nav-link" href="jdl-studio/">
                            <div class="menu-item-content">
                                <fa-icon icon="project-diagram" class="menu-icon"></fa-icon>
                                <span class="menu-text">JDL工作室</span>
                            </div>
                        </a>
                    </li>

                    <li class="nav-item" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">
                        <a class="nav-link" routerLink="/statistics">
                            <div class="menu-item-content">
                                <fa-icon icon="chart-line" class="menu-icon"></fa-icon>
                                <span class="menu-text">统计</span>
                            </div>
                        </a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
    <div class="col-md-9">
        <router-outlet></router-outlet>
        <router-outlet name="popup"></router-outlet>
    </div>
</div>

<style>
    /* Custom Styles for the Dashboard */
    .dashboard-container {
        min-height: 100vh;
    }

    /* Sidebar Styles */
    .side-menu {
        background-color: #2c3e50;
        color: white;
        padding: 0;
        min-height: 100vh;
    }

    .sidebar-header {
        padding: 20px;
        background-color: #1a252f;
        text-align: center;
    }

    .sidebar-alerts {
        padding: 10px;
    }

    .sidebar-alerts .alert {
        margin-bottom: 10px;
        font-size: 0.85rem;
        padding: 8px;
    }

    .nav-link {
        color: #ecf0f1;
        padding: 12px 20px;
        border-left: 4px solid transparent;
        transition: all 0.3s;
    }

    .nav-link:hover {
        background-color: #34495e;
        color: white;
    }

    .nav-link.active {
        background-color: #34495e;
        border-left: 4px solid #3498db;
        color: white;
    }

    .menu-item-content {
        display: flex;
        align-items: center;
    }

    .menu-icon {
        width: 24px;
        text-align: center;
        margin-right: 12px;
        font-size: 1.1rem;
    }

    .azure-icon {
        width: 24px;
        height: 24px;
        margin-right: 12px;
    }

    .menu-text {
        font-size: 0.9rem;
    }

    /* Main Content Styles */
    .main-content {
        padding: 0;
        background-color: #f5f7fa;
    }

    .top-navbar {
        background-color: white;
        padding: 0px 0px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .search-box {
        position: relative;
        width: 300px;
    }

    .search-box input {
        padding: 8px 15px 8px 35px;
        border: 1px solid #ddd;
        border-radius: 4px;
        width: 100%;
    }

    .search-box fa-icon {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        color: #95a5a6;
    }

    .user-actions {
        display: flex;
        align-items: center;
    }

    .notification-btn {
        background: none;
        border: none;
        position: relative;
        margin-right: 20px;
        color: #7f8c8d;
        font-size: 1.2rem;
    }

    .badge {
        position: absolute;
        top: -5px;
        right: -5px;
        background-color: #e74c3c;
        color: white;
        border-radius: 50%;
        padding: 2px 6px;
        font-size: 0.7rem;
    }

    .user-profile {
        display: flex;
        align-items: center;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        margin-right: 10px;
    }

    .user-name {
        font-weight: 500;
    }

    /* Content Wrapper */
    .content-wrapper {
        padding: 20px;
    }

    .page-title {
        font-size: 1.8rem;
        margin-bottom: 20px;
        color: #2c3e50;
    }

    /* Metrics Cards */
    .metrics-container {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        margin-bottom: 30px;
    }

    .metric-card {
        background-color: white;
        border-radius: 8px;
        padding: 20px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        text-align: center;
    }

    .metric-card h3 {
        font-size: 1.8rem;
        color: #2c3e50;
        margin-bottom: 5px;
    }

    .metric-card p {
        color: #7f8c8d;
        margin: 0;
    }

    /* Data Tables */
    .data-tables {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        margin-bottom: 20px;
    }

    .data-tables:last-child {
        grid-template-columns: repeat(4, 1fr);
    }

    .data-column {
        background-color: white;
        border-radius: 8px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .data-column h4 {
        color: #2c3e50;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 1px solid #eee;
    }

    .data-column ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .data-column li {
        padding: 8px 0;
        border-bottom: 1px solid #f5f5f5;
        color: #34495e;
    }

    .data-column li:last-child {
        border-bottom: none;
    }

    .col-md-3 {
        flex: 0 0 25%;
        max-width: 15%;
    }
</style>
